<?php

	// This will all be replaced by some clever code which retrieves a random image from
	// the doodles database.
	

	//$image_filter = $_REQUEST['image_filter'];
	//$year_filter = $_REQUEST['year_filter'];
	
	$id = @$_REQUEST['id'];
	
	include_once('allDoodles.php');
		
	$num = rand(0,3);
	
	foreach ($doodles as $this_doodle) {
		if ($this_doodle->doodle_id == $id) {
			$matched_doodle = $this_doodle; 
			break;
		}
	}
	
	if (isset($matched_doodle)) {	
		echo($matched_doodle->toXMLString());
	} else {
		$errorDoodle = new Doodle('NOT FOUND','NOT FOUND','NOT FOUND','NOT FOUND','NOT FOUND','NOT FOUND','NOT FOUND','NOT FOUND');
		echo($errorDoodle->toXMLString());
	}

?>